package cn.study.service.impl;

import cn.study.entity.StudyTestQuestionsMore;
import cn.study.entity.StudyTestQuestionsShortanswer;
import cn.study.mapper.StudyTestQuestionsShortanswerMapper;
import cn.study.service.StudyTestQuestionsShortanswerService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 简答试题表 服务实现类
 * </p>
 *
 * @author qiao
 * @since 2020-06-22
 */
@Service
public class StudyTestQuestionsShortanswerServiceImpl extends ServiceImpl<StudyTestQuestionsShortanswerMapper, StudyTestQuestionsShortanswer> implements StudyTestQuestionsShortanswerService {
    @Autowired
    StudyTestQuestionsShortanswerMapper studyTestQuestionsShortanswerMapper;

    @Override
    public List<StudyTestQuestionsShortanswer> shortLikeList(String shortval) {
        QueryWrapper<StudyTestQuestionsShortanswer> wrapper = new QueryWrapper<>();
        wrapper
                .like("test_questions_shortanswer_opic", shortval)
                .orderByDesc("create_time");

        return studyTestQuestionsShortanswerMapper.selectList(wrapper);
    }
}
